Tom,
Thanks for your help, that recommendation allowed us to implement the cycle start and pause buttons. The pendant uses the MPG to adjust feedrate override and spindle override. I saw some sample code for KMotionCNC but nothing for MACH3. Is there some sample code on how people implemented having the MPG adjust the feedrate and spindle speed as overrides? Many pendants has the rotary switch for X,Y,Z,A and Feed and Spindle which take the MPG input as the override percentage. It would calculate spindle or feedrate +/- override based on turning the MPG in Kflop and just update Mach3.
Another thing we noticed, when we zero the encoders in KFLOP they are not getting updated in Mach3.
Is there a way to have the Cycle Start LED in Mach3 trigger a KFLOP IO pin? This could be used to help keep things in sync with the kflop c code.
We are really getting excited the movement is very smooth and almost everything is working again. Thanks for all the help and advise. Lots of questions, I know so sorry. :)
Russ
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]
Sent: Saturday, June 28, 2014 3:47 PM
To:
DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] External Button Pushes
The KFLOP to PC commands are only supported in KMotionCNC.
To configure external buttons in Mach3:
Configure an OEM Trigger input. For example set:
Config | Ports and Pins | Inputs | OEM Trig #1 Pin46 Port1
Config | System Hot Keys | External Buttons | Trigger #1 = 1000
OEM code 1000 is for Cycle Start from:
Now toggling IO 46 on the KMotion Digital IO screen should perform a Cycle Start in Mach3
We have most of the KFLOP working on the machine now. We have motion, homing, MPG all working. Our biggest struggle is external buttons getting that info to respond in MACH3.
We have used the C example ExternalButtons.c and used a switch on the MPG for cycle start and loaded some gcode in mach3. The plugin has this loading into thread4. We can see the button on Kmotion on the IO screen perfect.
We have this narrowed down to the DoPC(PC_COMM_EXECUTE);
}while (result=persist.UserData[PC_COMM_PERSIST]>0); The program never seems to see the Persist data for the MACH3 handshake.
We have beat our heads against the wall and tried commenting everything out but one command and nothing that uses these DoPC calls works. We can send stuff from Mach3 to Kmotion
that always works fine. We just can't get it to work the other way around.
We must be missing something simple, but just can't seem to figure this out. So much is working this has to be something simple.
Any idea what we are doing wrong?